<?php
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript" src="/statics/xheditor/xheditor-zh-cn.min.js"></script>
<script type="text/javascript">
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
			$("#attr_value").formValidator({onshow:"请输入属性值名称",onfocus:"请输入属性值名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入属性值名称"});
});
//-->
</script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='<?php echo U('attribute/model_list');?>'><em>产品类型管理</em></a><span>|</span>
        <a href='<?php echo U('attribute/attribute_list', 'modelid='.$modelid);?>'><em><?php echo $model_name;?>-属性列表</em></a><span>|</span>
        <a href='<?php echo U('attribute/attribute_values_list', array('modelid'=>$modelid,'attrid'=>$attribute['attr_id']));?>'><em><?php echo $attribute['attr_name'];?> - 属性值列表</em></a><span>|</span>
        <a href='javascript:;' class="on" ><em>添加属性值</em></a></div>
</div>
<form name="myform" id="myform" action="__SELF__" method="post" enctype="multipart/form-data">
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<?php
$base_tab = 1;
$langCount = 0;
if(isset($languageList) && $languageList){
		$langCount = count($languageList);
}
$langCount += $base_tab;
?>
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',<?php echo $langCount;?>,1);">基本选项</li>
<?php
$i = $base_tab+1;
	if(isset($languageList) && $languageList):
		foreach ($languageList as $language_id => $language_name):
	?>
<li id="tab_setting_<?php echo $i;?>" onclick="SwapTab('setting','on','',<?php echo $langCount;?>,<?php echo $i;?>);"><?php echo $language_name;?></li>
<?php
		$i++;
		endforeach;
	endif;
	?>

</ul>
<div id="div_setting_1" class="contentList pad-10">

<table width="100%" class="table_form ">
      <tr>
		<th width="100">图片1：</th>
		<td><input type="file" name="upimage" id="upimage" value="" size="50" />
		<?php if($attvalInfo['attr_img']){?>
		<input type="hidden" name="attr_img" value="<?php echo $attvalInfo['attr_img'];?>" />
		<div style="text-align:center"><img src="<?php echo $attvalInfo['attr_img'];?>" /></div>
		<?php }?>
		</td>
	  </tr>
	  <tr>
		<th width="100">图片2：</th>
		<td><input type="file" name="upimage2" id="upimage2" value="" size="50" />
		<?php if($attvalInfo['attr_img2']){?>
		<input type="hidden" name="attr_img2" value="<?php echo $attvalInfo['attr_img2'];?>" />
		<div style="text-align:center"><img src="<?php echo $attvalInfo['attr_img2'];?>" /></div>
		<?php }?>
		</td>
	 </tr>
     <tr>
		<th width="100">示意图：</th>
		<td><input type="file" name="up_libu_img" id="libu_img" value="" size="50" />
		<?php if($attvalInfo['libu_img']){?>
		<input type="hidden" name="libu_img" value="<?php echo $attvalInfo['libu_img'];?>" />
		<div style="text-align:center"><img src="<?php echo $attvalInfo['libu_img'];?>" /></div>
		<?php }?>
		</td>
	 </tr>
     <?php if($attribute['attr_pro_type'] == 4):?>
       <tr>
        <th>所在类型：</th>
        <td>
          <?php foreach(C('size_type') as $val):?>
          <input type="radio" value="<?php echo $val['id'];?>" name="size_type" <?php if(isset($attvalInfo['size_type']) && $attvalInfo['size_type']==$val['id'])echo 'checked';?>>
          <?php echo $val['type_name'];?> 
          <?php endforeach;?>        
         </td>
      </tr>
      <?php endif;?>  
       <tr>
        <th>定制附加费用：</th>
        <td>
        <input type="text" name="add_money" id="add_money" class="input-text" size="5" value="<?php echo isset($attvalInfo['add_money']) ? $attvalInfo['add_money'] : 0.00;?>"/>$
      (没有附加费用填0)
        </td>
      </tr>  
		 <tr>
        	<th>3D文件夹名称：</th>
        	<td>
	  			<input type="text" name="desc_name" id="desc_name" class="input-text" size="20" value="<?php echo isset($attvalInfo['desc_name']) ? $attvalInfo['desc_name'] : '';?>"/>
        	</td>
      	</tr>   
	  <tr>
        <th>排序：</th>
        <td><input type="text" name="sort_order" id="sort_order" class="input-text" size="5" value="<?php echo isset($attvalInfo['sort_order']) ? $attvalInfo['sort_order'] : 0;?>"/></td>
      </tr>
</table>
</div>
<?php
$i = $base_tab+1;
	if(isset($languageList) && $languageList):
		foreach ($languageList as $language_id => $language_name):
?>
<div id="div_setting_<?php echo $i;?>" class="contentList pad-10 hidden">
<table width="100%" id="properties-table" align="center">
  	<tr>
        <th width="100">属性值名称：</th>
        <td><input type="text" name="attrValue[<?php echo $language_id;?>][attr_value]" id="attr_value_<?php echo $language_id;?>" class="input-text" value="<?php echo isset($attvalInfo['items'][$language_id]['attr_value']) ? $attvalInfo['items'][$language_id]['attr_value'] : null;?>"/> &nbsp;&nbsp;
		</td>
      </tr>
        <tr>
      	<th>属性描述:</th>
      	<td>
		  <textarea name="attrValue[<?php echo $language_id;?>][attr_content]" class="editor" style="width: 629px; height: 125px;"><?php echo isset($attvalInfo['items'][$language_id]['attr_content']) ? $attvalInfo['items'][$language_id]['attr_content'] : null;?></textarea>
        </td>
      </tr>

 </table>
</div>
<?php
		$i++;
		endforeach;
	endif;
?>
 <div class="bk15"></div>
    <input name="dosubmit" type="submit" value="提交" class="button" id="dosubmit">
</form>

</body>
</html>